// 一个细胞，一小时分裂一次，生命周期是3小时，n小时后有多少细胞
function count(hours) {
  var old = function (hours) {
    if (hours === 0 || hours === 1) {
      return 0
    }
    return young(hours - 1)
  }

  var young = function (hours) {
    if (hours === 0) {
      return 0
    }
    return birth(hours - 1)
  }

  var birth = function (hours) {
    if (hours === 0) {
      return 1
    }
    return young(hours - 1) + old(hours - 1) + birth(hours - 1)
  }
  return young(hours) + old(hours) + birth(hours)
}

console.log(count(5))